#include "cmaterial.h"

/**
 * setStrName - sets name of material
 * @param strName
 */ 
void CMaterial::setStrName(string strName) {
  this->strName = strName;
}
//---------------------------------------------------------------------------

/**
 * setStrTextureFileName - sets path to texture of material
 * @param strPath
 */ 
void CMaterial::setStrTextureFileName(string strPath) {
  
  // Save path and name of file with texture
  this->strTextureFileName = strTextureFileName;
  
  // If name is empty, material does not have texture applied
  textureProvided = strlen(strTextureFileName.c_str()) > 0;
}
//---------------------------------------------------------------------------

/**
 * setAmbient - sets material reflection of ambient light
 * @param ambient
 */ 
void CMaterial::setAmbient(CColor ambient) {
  this->ambient = ambient;
}
//---------------------------------------------------------------------------

/**
 * setDiffuse - sets material reflection of diffuse light
 * @param diffuse
 */ 
void CMaterial::setDiffuse(CColor diffuse) {
  this->diffuse = diffuse;
}
//---------------------------------------------------------------------------

/**
 * setSpecular - sets material reflection of specular light
 * @param specular
 */ 
void CMaterial::setSpecular(CColor specular) {
  this->specular = specular;
}
//---------------------------------------------------------------------------

/**
 * setShininess - setss material shininess
 * @param shininess
 */ 
void CMaterial::setShininess(short shininess) {
  this->shininess = shininess;
}
//---------------------------------------------------------------------------

/**
 * setTransparency - sets material transparency
 * @param transparency
 */ 
void CMaterial::setTransparency(short transparency) {
  this->transparency = transparency;
}
//---------------------------------------------------------------------------

/**
 * setTextureId - sets material texture id
 * @param textureId
 */ 
void CMaterial::setTextureId(TIndex textureId) {
  this->textureId = textureId;
}
//---------------------------------------------------------------------------

/**
 * setTileU - sets material U tile
 * @param tileU
 */ 
void CMaterial::setTileU(float tileU) {
  this->tileU = tileU;
}
//---------------------------------------------------------------------------

/**
 * setTileV - sets material V tile
 * @param tileV
 */ 
void CMaterial::setTileV(float tileV) {
  this->tileV = tileV;
}
//---------------------------------------------------------------------------

/**
 * setOffsetU - sets material U offset
 * @param offsetU
 */ 
void CMaterial::setOffsetU(float offsetU) {
  this->offsetU = offsetU;
}
//---------------------------------------------------------------------------

/**
 * setOffsetV - sets material V offset
 * @param offsetV
 */ 
void CMaterial::setOffsetV(float offsetV) {
  this->offsetV = offsetV;
}
//---------------------------------------------------------------------------

/**
 * getStrName - returns name of material
 * @return material name
 */ 
string CMaterial::getStrName() const {
  return strName;
}
//---------------------------------------------------------------------------

/**
 * getStrTextureFileName - returns path to texture file
 * @return texture file path
 */ 
string CMaterial::getStrTextureFileName() const {
  return strTextureFileName;
}
//---------------------------------------------------------------------------

/**
 * getAmbient - returns material reflection of ambient light
 * @return reflection of ambient light
 */
CColor CMaterial::getAmbient() const {
  return ambient;
}
//---------------------------------------------------------------------------

/**
 * getDiffuse - returns material reflection of diffuse light
 * @return reflection of diffuse light
 */
CColor CMaterial::getDiffuse() const {
  return diffuse;
}
//---------------------------------------------------------------------------

/**
 * getSpecular - returns material reflection of specular light
 * @return reflection of specular light
 */
CColor CMaterial::getSpecular() const {
  return specular;
}
//---------------------------------------------------------------------------

/**
 * getShininess - returns shininess of material
 * @return material shininess
 */
short CMaterial::getShininess() const {
  return shininess;
}
//---------------------------------------------------------------------------

/**
 * getTransparency - returns transparency of material
 * @return transparency
 */
short CMaterial::getTransparency() const {
  return transparency;
}
//---------------------------------------------------------------------------

/**
 * getTextureId - retruns id of material texture
 * @return texture id
 */
int CMaterial::getTextureId() const {
  return textureId;
}
//---------------------------------------------------------------------------

/**
 * getTileU - returns U tile
 * @return U tile
 */
float CMaterial::getTileU() const {
  return tileU;
}
//---------------------------------------------------------------------------

/**
 * getTileV - returns V tile
 * @return V tile
 */
float CMaterial::getTileV() const {
  return tileV;
}
//---------------------------------------------------------------------------

/**
 * getOffsetU - returns U offset
 * @return U offset
 */
float CMaterial::getOffsetU() const {
  return offsetU;
}
//---------------------------------------------------------------------------

/**
 * getOffsetV - returns V offset
 * @return V offset
 */
float CMaterial::getOffsetV() const {
  return offsetV;
}
//---------------------------------------------------------------------------
